{ Videokiosk
  videokiosk.lpr

  Copyright (C) 2010 Malcolm Poole <mgpoole@users.sourceforge.net>

  This source is free software; you can redistribute it and/or modify it under
  the terms of the GNU General Public License as published by the Free
  Software Foundation; either version 3 of the License, or (at your option)
  any later version.

  This code is distributed in the hope that it will be useful, but WITHOUT ANY
  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
  details.

  A copy of the GNU General Public License is available on the World Wide Web
  at <http://www.gnu.org/copyleft/gpl.html>. You can also obtain it by writing
  to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
  MA 02111-1307, USA.
}
program videokiosk;

{$mode objfpc}{$H+}

uses
  {$IFDEF UNIX}{$IFDEF UseCThreads}
  cthreads,
  {$ENDIF}{$ENDIF}
  Interfaces, // this includes the LCL widgetset
  Forms, mainpanel, LResources, screenconfig, background, about
  { you can add units after this }
  , Sysutils, Controls;

{$IFDEF WINDOWS}{$R videokiosk.rc}{$ENDIF}

begin
  Application.Title := 'Videokiosk';
  {$I videokiosk.lrs}
  Application.Initialize;
  Application.Createform ( Tcontrolscreen, Controlscreen ) ;
  Application.Createform ( Tconfigform, Configform ) ;
  if Screen.MonitorCount > 1 then
     begin
       Application.Createform ( Tvideoscreenbackground, Videoscreenbackground ) ;
       if ControlScreen.VideoBackground<>''
           then VideoScreenBackground.BackgroundImage.Picture.LoadFromFile(ControlScreen.Videobackground)
           else VideoScreenBackground.BackgroundImage.Picture.LoadFromFile('default.png');
       VideoScreenBackground.Show;
     end;
  ControlScreen.PrepareScreens('');
  Application.Createform ( Taboutform, Aboutform ) ;
  ControlScreen.Show;
if ConfigForm.ShowSplash then
   begin
    Aboutform.Show;
    Application.ProcessMessages;
    Sleep(1000);
    Aboutform.Hide;
   end;
  AboutForm.FormStyle:=fsNormal;
  AboutForm.BorderStyle := bsSizeable;
  AboutForm.OKBtn.Visible := true;
  Application.Run;
end.

